package Server.Dwc.DwcTemplate;

import java.util.Random;

import Server.Model.Base.IServerUserItem;

public class Constants {

	public static final int INVALID_CHAIR = 255;
	public static final int STAGE_NULL = 0;
	public static final int STAGE_FAPAI_1 = 1;
	public static final int STAGE_QIANGZHUANG = 2;
	public static final int STAGE_XIAZHU = 3;
	public static final int STAGE_FAPAI_2 = 4;
	public static final int STAGE_JIESUAN = 5;

	public static final int SUB_S_GAME_START = 100; // ��Ϸ��ʼ

	public static final int SUB_S_ADD_GOLD = 101; // ��ע���
	public static final int SUB_S_GIVE_UP = 102; // ������ע
	public static final int SUB_S_SEND_CARD = 103; // ������Ϣ
	public static final int SUB_S_GAME_END = 104; // ��Ϸ����
	public static final int SUB_S_KAIPAI = 105; // ���� //add
	public static final int SUB_S_KANPAI = 106; // ���� //add
	public static final int SUB_S_OVER = 107; // add

	public static final int SUB_GF_SCENE = 111;
	public static final int SUB_GF_SIT = 112;
	public static final int SUB_GF_STANDUP = 113;

	public static final int GAME_KIND = 13;
	public static final int INIT_TOTAL = 0; // �ƾ�ȫ�����
	public static final int INIT_FIRST_ROUND = 1; // �ƾ�ȫ�����
	public static final int INIT_NEWROUND = 2; // Ϊ����һ�ѳ�ʼ��һЩ����

	public static final int sizeof(long[] m_LookOnUserID) {
		return m_LookOnUserID.length;
	}

	public static void memset(long[] by, int by2, int length) {
		for (int i = 0; i < length; i++) {
			by[i] = (long) by2;
		}

	}

	public static Random rd = new Random();

	public static final int rand() {
		return rd.nextInt(1000);
	}

	public static int rand(int i, int j) {
		return  rand(i,j,0);
	}
	public static final int rand(int i, int j, int factor) {
		return rd.nextInt(j - i) + i;
	}

	public static void CopyMemory(int[] by, int by2, int length) {
		for (int i = 0; i < length; i++) {
			by[i] = by2;
		}
	}

	public static void CopyMemory(int[] by, int[] by2, int length) {
		for (int i = 0; i < length; i++) {
			by[i] = by2[i];
		}
	}

	public static void memcpy(int[] by, int[] by2, int length) {
		for (int i = 0; i < length; i++) {
			by[i] = by2[i];
		}
	}

	public static void memset(int[] by, int by2, int length) {
		for (int i = 0; i < length; i++) {
			by[i] = by2;
		}
	}

	public static final int CountArray(int by[]) {
		return by.length;
	}

	public static final int sizeof(int[] m_byParam) {
		return m_byParam.length;
	}

	public static final int sizeof(IServerUserItem[] m_pIUserItem) {
		return m_pIUserItem.length;
	}

	//////////////////////////////////////////////////////////////////////////
	// ��Ϣ�ṹ��
	// �û�״̬����
	public static final int US_NULL = 0x00; // û��״̬
	public static final int US_READY = 0x01; // ͬ��״̬
	public static final int US_PLAY = 0x02; // ��Ϸ״̬

	public static final int US_FREE = 0x10; // վ��״̬
	public static final int US_SIT = 0x11; // ����״̬
	public static final int US_LOOKON = 0x12; // �Թ�״̬
	public static final int US_OFFLINE = 0x13;
	public static final int GS_FREE = 0;
	public static final int GS_PLAYING = 100;
	public static final int GAME_END_DISMISS = 4;
	public static final int GAME_END_NORMAL = 0;

	public static int atoi(String string) {
		try {
			return Integer.parseInt(string);
		} catch (Exception e) {

		}
		return 0;
	}

	public static int sizeof(SSeatInfo[] m_seatInfo) {
		return m_seatInfo.length;
	}

	public static void memset(SSeatInfo[] m_seatInfo, int by2, int sizeof) {
		for (int i = 0; i < m_seatInfo.length; i++) {
			m_seatInfo[i] = new SSeatInfo();
		}
	}

	public static long time(Object object) {
		return System.currentTimeMillis();
	}


}
